package com.ypz.reggie.common;

/**
 * 工具类，一般都用static.
 * 作用：往线程里放数据与取数据.
 * LoginCheckFilter，EmployeeController，MyMetaObjectHandler属于同一个线程
 */
public class MyBaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal();

    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }

}


